<%@page import="student.Student"%>
<%@page import="subject.Subject"%>
<%@page import="subject.SubjectDao"%>
<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>科目列表</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

</head>

<body>
	<%@include file="checklogin.jsp" %>
	<div align="center">
		<div><%=student.getSname() %>,已登录</div>
		<a href="addSubject.jsp">新增课程</a>
	</div>
	<div align='center'>
		<table border='1px' cellspacing='0px'
			style='text-align:center;border-collapse:collapse'>
			<tr>
				<th>编号</th>
				<th>学科名称</th>
				<th>学时</th>
				<th>年级</th>
			</tr>
			<%
				SubjectDao sbDao=new SubjectDao();
		  		List<Subject> list=sbDao.sblist();
		  		for(Subject s:list)
		  		{
			%>
			<tr>
				<td><%=s.getId()%></td>
				<td><%=s.getSubjectname()%></td>
				<td><%=s.getClasshour()%></td>
				<td><%=s.getGradeid()%></td>
			</tr>
			<%
				}
			%>
		</table>
	</div>
</body>
</html>